import request from '@/utils/request'

// 获取慢性病列表
export const getDiseaseList = (params) => {
  return request.get('/admin/chronic-disease/page', { params })
}

// 获取慢性病列表——用于统计
export const getDiseaseListData = (params) => {
  return request.get('/admin/chronic-disease/page/data', { params })
}
// 新增慢性病
export const addDisease = (data) => {
  return request.post('/admin/chronic-disease', data)
}

// 更新慢性病
export const updateDisease = (data) => {
  return request.put('/admin/chronic-disease', data)
}

// 删除慢性病
export const deleteDisease = (id) => {
  return request.delete(`/admin/chronic-disease/${id}`)
}

// 修改慢性病状态(删除使用)
export const changeDiseaseStatus = (id, status) => {
  return request.post(`/admin/chronic-disease/status/${status}`, null, {
    params: { id }
  })
}

// 根据慢性病id查询该病种类的信息
export const getTypeInfo = (id) => {
  return request.get(`/admin/chronic-disease/type/${id}`)
}
